nfcTagReceived
Type
message
Summary
Sent to the current card when the application receives data from an NFC tag read by the device.
Syntax
nfcTagReceived <ncfTag>
Description
When an NFC tag is read by the device, information about that tag will be dispatched to apps which are configured to handle that tag data. The nfcTagReceived handler will be called whenever NFC tag data is dispatched to your app, and can then be used to obtain the tag information.
The mobileEnableNFCDispatch command can be used to ensure NFC tag data is sent to your app while it is running in the foreground.
If your application no longer needs to intercept NFC tag data then call mobileDisableNFCDispatch to allow tag data to be dispatched to other apps once more.
Parameters
Name | Type | Description |
---|---|---|
ncfTag | array | The NFC tag data received, formatted as an array with the following entries
|
Examples
on nfcTagReceived pTag
handleNewTagID pTag["id"]
if pTag["ndef"] is an array then
// handle first Ndef record on tag
handleNdefData pTag["ndef"][1]
end if
end nfcTagReceived
Related
command: mobileEnableNFCDispatch, mobileDisableNFCDispatch
function: mobileIsNFCAvailable, mobileIsNFCEnabled
glossary: current card, application
Compatibility and Support
Introduced
LiveCode 9.0
OS
android
Platforms
mobile